package com.job.yangshida.homework0715;

import java.util.Arrays;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-16 10:54:53
 */
public class String2 {
    public static void main(String[] args) {
        //把数字按照Unicode把数租按照码值转成字符串
        byte[] b1={11,22,33,44,55,65};
        String s1=new String(b1);
        System.out.println(s1);
        s1=new String(b1, 1, 5);
        System.out.println(s1);
        char[] c={'a','s','d','f'};
        String s=new String(c);
        System.out.println(s);
        System.out.println(new String(c));
        //zi字符串变数组
        byte[] c2=s.getBytes();
        System.out.println(Arrays.toString(c2));
        char[] c3=s.toCharArray();
        System.out.println(Arrays.toString(c3));
        String s4="邀请您参加腾讯会议";
        b1=s4.getBytes();
        System.out.println("+++"+Arrays.toString(b1));
        System.out.println("---"+new String(b1));
        c3=s4.toCharArray();
        System.out.println(Arrays.toString(c3));
        char c1=s4.charAt(2);//xai下标
        System.out.println(c1);
        char c4='a';
        System.out.println(c4+1);
        System.out.println(c1+s4.length());
        System.out.println(""+c1+s4.length());
        for (int i=0;i<s4.length();i++){
            System.out.println(""+i+s4.charAt(i));
        }
        //qi求大写字母数
        int count=0;
        String s5="System.out.println(Arrays.toString(b1));";
        for (int i=0;i<s5.length();i++){
            if (Character.isUpperCase(s5.charAt(i))){
                count++;
            }
        }
        System.out.println("ygy一共有大写"+count+"ge");
        int co=0;
        for (int i=0;i<s5.length();i++) {
            if (Character.isUpperCase(new String(s5.getBytes()).charAt(i))) {
                co++;
            }
        }
        System.out.println(new String(s5.getBytes()));
        System.out.println(co);//for (int i=0;i<n;i++){};
        for (int i=0;i<10;i++){

        }
    }
}
